<?php
/**
 * PicBoard application bootstrapper
 *
 * File initialises the configuration for PicBoard, sets some global variables and defines PHP's __autoload() for classes
 *
 * PHP version 5
 *
 * LICENSE: <LICENCE-HERE>
 *
 * @author     Sebastian Skuse <scs@ecs.soton.ac.uk>
 * @copyright  2009-2010 University of Southampton
 * @license    http://<LICENSE-URL>  <LICENSE-NAME>
 * @version    $1:$
 */
error_reporting(E_ALL);
require_once("conf.php");
require_once(SYS_CLASSDIR . "PicBoardException.class.php");

define('SYS_VER', "0.9.4911");

// Outputs for printing
define('REGISTERED_OUTPUTS', serialize(array(
	"defaultFormat",
	"techTalk8",
	"techScan8",
	"smartScan8",
	"goTalk9",
	"techSpeak32",
	"goTalk4"
)));


// This function auto loads classes.
function __autoload($class_name) {
	
	$paths = array(
		SYS_CLASSDIR . $class_name . ".class.php",
		SYS_CLASSDIR . "API/services/" . $class_name . ".class.php",
		SYS_CLASSDIR . "API/services/" . $class_name . ".class.php",
		SYS_CLASSDIR . "printFormatters/" . $class_name . ".class.php"
	);
	
	foreach($paths as $path){
		if(file_exists($path)) {
			require_once($path);
			continue;
		}
	} 

	if (!class_exists($class_name, false)) {
   		trigger_error("Unable to load class: $class_name", E_USER_WARNING);
  	}

}

?>